package com.auxgroup.smarthome.repo;


import com.auxgroup.smarthome.entity.DeviceFaultEntity;
import org.springframework.data.jpa.repository.Query;
import java.util.List;

/**
 * Created by lixiaoxiao on 17-8-7.
 */
public interface DeviceFaultRepo  extends GenericDao<DeviceFaultEntity,String> {

    @Query(value = "select * from device_fault f" +
            " where f.mac LIKE ?1 limit ?2,?3",nativeQuery = true)
    List<DeviceFaultEntity> findByMac(String mac, int page, int size);

    DeviceFaultEntity findByMacAndStatus(String mac, int status);

}
